package com.wel.onlineshopping.repository;

import com.wel.onlineshopping.model.Product;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface ProductRepository extends JpaRepository<Product, Long> {

    // 根据产品名称模糊搜索
    List<Product> findByNameContaining(String name);

    // 根据价格范围搜索
    List<Product> findByPriceBetween(Double minPrice, Double maxPrice);
}
